{extend name="default/users/base" /}
{block name="title"}用户中心 - {:WSTConf('CONF.shopName')}{__block__}{/block}
{block name="css"}
{/block}
{block name="main"}
{block name="content"}
            <div class="result" style="margin:-1px;border:1px solid #fff;">
              <div class="ucenterInfo">
                <ul class="userInfo">
                  <li>
                    <p class="ucName">嗨，<span>{$data['loginName']}</span></p>
                    <span class="wst-sec-infoi" id="level"></span>
                    <div class="wst-sec-infoi" style="margin-top:5px;">
                      <span class="wst-sec-strip wst-lfloat">{if ($data['loginPwd'])}<span class="wst-sec-strip2 wst-lfloat"></span>{/if}{if ($data['userEmail'])}<span class="wst-sec-strip2 wst-lfloat"></span>{/if}{if ($data['userPhone'])}<span class="wst-sec-strip2 wst-lfloat"></span>{/if}</span>
                    </div>
                    <div class="wst-clear"></div>
                    <div class="wst-sec-infoi" style="margin-top:5px;">
                      <span>上次登录时间：{php}echo date("Y-m-d H:i",strtotime($data['lastTime']));{/php}</span>
                      <br/>
                      <span style="display:block;margin-top:3px;">上次登录IP：{$data['lastIP']}</span>
                    </div>
                  </li>
                  <li class="money">
                      <p onclick="goMoney();"><span class="moneyIcon"></span>我的余额:<span class="r">￥{$data['userMoney']}</span></p>
                      <p onclick="goScore();"><span class="scoreIcon"></span>我的积分:<span class="b">{$data['userScore']}</span>积分</p>
                  </li>
                  <li class='money'>
                    <p onclick="location.href='{:url('home/useraddress/index')}'"><span class="addrIcon"></span>我的收货地址</p>
                    <p onclick="location.href='{:url('home/users/edit')}'"><span class="infoIcon"></span>编辑个人资料</p>
                  </li>
                </ul>
              </div>
              <ul class="orderStatus">
              	<li onclick="location.href='{:url('home/orders/waitPay')}'">
              		<span class="uc-order-icon1"></span>
              		<p class="ucNum">{$order['waitPay']}</p>
              		<p>待付款订单</p>
              	</li>
              	<li onclick="location.href='{:url('home/orders/waitSend')}'">
              		<span class="uc-order-icon2"></span>
              		<p class="ucNum">{$order['waitSend']}</p>
              		<p>待发货订单</p>
              	</li>
              	<li onclick="location.href='{:url('home/orders/waitReceive')}'">
              		<span class="uc-order-icon3"></span>
              		<p class="ucNum">{$order['waitReceive']}</p>
              		<p>待收货订单</p>
              	</li>
              	<li onclick="location.href='{:url('home/orders/waitAppraise')}'">
              		<span class="uc-order-icon4"></span>
              		<p class="ucNum">{$order['waitAppr']}</p>
              		<p>待评价订单</p>
              	</li>
              	<li onclick="location.href='{:url('home/orders/abnormal')}'">
              		<span class="uc-order-icon5"></span>
              		<p class="ucNum">{$order['reject']}</p>
              		<p>退款/拒收订单</p>
              	</li>
              </ul>

              <div class="uc-goods-box">
              	<div class="wst-user-head"><span>为您推荐</span></div>
              	{wst:goods type='recom' num='5' id='rec'}
              	<div class="rnbh-goods">
          					<a class="rnbg-imgbox" href="{:Url("home/goods/detail","id=".$rec["goodsId"])}" target="_blank">
          						<img class='goodsImg' data-original="__ROOT__/{:WSTImg($rec['goodsImg'])}"  title="{$rec['goodsName']}"/>
          					</a>
          					<p class="rnbh-goodsName">
          						<a href='{:Url("home/goods/detail","id=".$rec["goodsId"])}' target='_blank'>
          							{$rec['goodsName']}
          						</a>
          					</p>
          					<div class="rnbh-goodsInfo">
          						<span class="rnbh-goodsprice">￥{$rec['shopPrice']}</span>
          						<span class="rnbh-goodssale">成交量：<em>{$rec['saleNum']}</em></span>
          					</div>
          					<a class="rnbh-addcart" href="javascript:WST.addCart({$rec['goodsId']});" >加入购物车</a>
          				</div>
          				{/wst:goods}
              </div>

              <div class="uc-goods-box">
              	<div class="wst-user-head"><span>我的关注</span></div>
              	{volist name='$favorites' id="fa" length="5"}
              	<div class="rnbh-goods">
					<a class="rnbg-imgbox" href="{:Url("home/goods/detail","id=".$fa["goodsId"])}" target="_blank">
						<img class='goodsImg' data-original="__ROOT__/{:WSTImg($fa['goodsImg'])}"  title="{$fa['goodsName']}"/>
					</a>
					<p class="rnbh-goodsName">
						<a href='{:Url("home/goods/detail","id=".$fa["goodsId"])}' target='_blank'>
							{$fa['goodsName']}
						</a>
					</p>
					<div class="rnbh-goodsInfo">
						<span class="rnbh-goodsprice">￥{$fa['shopPrice']}</span>
						<span class="rnbh-goodssale">成交量：<em>{$fa['saleNum']}</em></span>
					</div>
					<a class="rnbh-addcart" href="javascript:WST.addCart({$fa['goodsId']});" >加入购物车</a>
				</div>
				{/volist}
              </div>

              <div class="uc-goods-box">
              	<div class="wst-user-head"><span>我的足迹</span></div>
                      	{wst:goods type='history' num='5' id="his"}
                      	<div class="rnbh-goods">
        					<a class="rnbg-imgbox" href="{:Url("home/goods/detail","id=".$his["goodsId"])}" target="_blank">
        						<img class='goodsImg' data-original="__ROOT__/{:WSTImg($his['goodsImg'])}"  title="{$his['goodsName']}"/>
        					</a>
        					<p class="rnbh-goodsName">
        						<a href='{:Url("home/goods/detail","id=".$his["goodsId"])}' target='_blank'>
        							{$his['goodsName']}
        						</a>
        					</p>
        					<div class="rnbh-goodsInfo">
        						<span class="rnbh-goodsprice">￥{$his['shopPrice']}</span>
        						<span class="rnbh-goodssale">成交量：<em>{$his['saleNum']}</em></span>
        					</div>
        					<a class="rnbh-addcart" href="javascript:WST.addCart({$his['goodsId']});" >加入购物车</a>
        				</div>
        				{/wst:goods}
              </div>

            </div>
            {/block}
{/block}
{block name="js"}
<script>
$(function(){
  var securityCount = $('.wst-sec-strip2').length;
  if(securityCount==1){
     $('#level').html('安全级别(较低级)&nbsp; &nbsp; &nbsp;<span class="wst-sec-infoin" id="warn">建议提升安全</span>');
  }else if(securityCount==2){
     $('#level').html('安全级别(中级)&nbsp; &nbsp; &nbsp;<span class="wst-sec-infoin" id="warn">建议提升安全</span>');
  }else if(securityCount==3){
     $('#level').html('安全级别(高级)&nbsp; &nbsp; &nbsp;<span class="wst-sec-infoin" id="safe">建议定期更改密码</span>');
  }else{
     $('#level').html('安全级别(低级)&nbsp; &nbsp; &nbsp;<span class="wst-sec-infoin" id="warn">账号有风险</span>');
  }
});
function goMoney(){location.href=WST.U('home/logmoneys/usermoneys',{'id':43})}
function goScore(){location.href=WST.U('home/userscores/index',{'id':43})}
</script>
{/block}